{% load staticfiles %}
{% include "header.html" %}

<div class="container" style="padding-left: 0px;padding-right: 0px;">
    <div class="detail-left">
        {% csrf_token %}
        <form class="article-comment" action="/leave/" method="post">
            <textarea class="article-comment-input" type="text" name="text"></textarea>
            <input class=" article-comment-submit edit-submit" type="submit" value="留言">
        </form>
        <div class="line"></div>
        {% for leave in leaves %}
            <div class="comment-box">

                {% if leave.user.icon %}
                    <a href="/user/{{ leave.user.username }}">
                        <img class="comment-icon" src="/media/{{ leave.user.icon }}">
                    </a>
                {% else %}
                    <img class="comment-icon" src="{% static "icon.jpg" %}">
                {% endif %}
                <div class="comment-name-box">
                    {% if leave.user.name %}
                        <a href="/user/{{ leave.user.username }}" class="comment-name">{{ leave.user.name }}</a>
                    {% else %}
                        <a class="comment-name">游客</a>
                    {% endif %}
                    <a class="comment-time"> · {{ leave.pub_date|date:"Y-m-d  H:i" }}</a>
                </div>
                <a class="comment-content">{{ leave.text }} </a>
            </div>
        {% endfor %}

    </div>
</div>

{% include "footer.html" %}